// pages/my/my-faq/my-faq.js
var request = require('../../../utils/request.js');
var app = getApp();
Page({

  /**
   * 页面的初始数据
   */
  data: {
    showModal:false
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    var that = this;
    request.getQuestionList({},
      (res)=>{
        console.log(res)
        that.setData({
          list:res.data.data
        })
      }
    )
  },

  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady: function () {

  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function () {

  },
  showBox:function(e){
    var that = this;
    var tempContent;
    for(var i = 0;i<that.data.list.length;i++){
      if (that.data.list[i].id == e.currentTarget.dataset.id){
        tempContent = that.data.list[i]
      }
    }
    that.setData({
      showModal: true,
      tempList: tempContent
    })
    

  },
  goNothandle:function(){
    var that = this;
    wx.makePhoneCall({
      phoneNumber: "400-6338-365"
    })
    that.setData({
      showModal: false
    })
  },
  closeModal:function(){
    var that = this;
    that.setData({
      showModal:false
    })
  },
  maketel:function(){
    var that = this;
    wx.makePhoneCall({
      phoneNumber: "400-6338-365"
    })
  }

})